import random
import time
import chess
from src.chess_util import Chess
import src.evaluate as evaluate

tal_chess = Chess()
fen = 'r1b1qrk1/ppp2ppp/1bn5/PB1pP3/3P4/2n1BN2/P4PPP/R2Q1K1R w - - 0 12'
if __name__ == '__main__':
    begin = time.time()
    board = chess.Board(fen)
    board.set_fen(fen)

    res = tal_chess.parse_internal_board_info(board,fen)

    keys = res.keys()
    keys = list(keys)
    for i in range(len(keys)):
        print("\033[1;36m key = [{}] \033[0m ,value = {}".format(keys[i], res[keys[i]]))
    # print(res)
    print('board->\n', board)
    score = tal_chess.do_evaluate(board, res)
    print('score->', score)
    end_time = time.time()
    print("花费的时间为 ", end_time - begin)
    print(board.result())
